package com.chatplus.application.domain.request;

import com.chatplus.application.common.crypto.CryptoValue;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Objects;

/**
 * 登录请求信息
 * @author weird
 */
public class AccountLoginRequest implements  Serializable {
    private static final long serialVersionUID = -3081352005273150641L;
    /**
     * 登录号
     */
    @NotBlank(message = "登录号不能为空")
    private String username;
    /**
     * 短信验证码
     */
    private String verifyCode;
    /**
     * 登录密码（预留，当前未使用）
     */
    private String password;

    /**
     * 加密密码串（预留，当前未使用）
     */
    private CryptoValue cryptoPassword;

    /**
     * 小程序登录授权码
     */
    private String code;

    /**
     * 是否记住我（用来决定登录cookie失效时间）
     */
    private Boolean rememberMe;

    /**
     * 注册渠道
     */
    private Integer registerChannel;

    /**
     * 获取用户手机号的token,用于一键登录
     */
    private String mobileToken;

    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public CryptoValue getCryptoPassword() {
        return cryptoPassword;
    }

    public void setCryptoPassword(CryptoValue cryptoPassword) {
        this.cryptoPassword = cryptoPassword;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Boolean getRememberMe() {
        return Objects.isNull(rememberMe) || rememberMe;
    }

    public void setRememberMe(Boolean rememberMe) {
        this.rememberMe = rememberMe;
    }

    public Integer getRegisterChannel() {
        return registerChannel;
    }

    public void setRegisterChannel(Integer registerChannel) {
        this.registerChannel = registerChannel;
    }

    public String getMobileToken() {
        return mobileToken;
    }

    public void setMobileToken(String mobileToken) {
        this.mobileToken = mobileToken;
    }
}
